package com.why.config;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.DriverManager;
import java.util.Properties;

import com.why.SdbcpConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 初始化配置配置类，初始化连接驱动
 *
 * @author wanghongyang24
 */
public class SdbcpInitial {
    protected final Logger log = LoggerFactory.getLogger(SdbcpInitial.class);
    private SdbcpBaseConfig sdbcpBaseConfig;

    //注册驱动  仅仅支持jdbc
    {

        try (FileInputStream stream = new FileInputStream(SdbcpConstant.PROPERTIES_LOCATION.getName())) {
            Class.forName("com.mysql.cj.jdbc.Driver");
            log.info("加载mysql驱动成功~");
            Properties properties = null;
            properties = new Properties();
            properties.load(stream);
            log.info("开始赋值");

        } catch (IOException | ClassNotFoundException e) {
            log.error("加载mysql驱动失败...");
            e.printStackTrace();
        }


    }


    public SdbcpBaseConfig getSdbcpBaseConfig() {

        return null;
    }


}
